package com.ahwei.product.api.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigDecimal;

/**
 * <p>
 * 这是一个Java文件！
 * </p>
 *
 * @author： ahWei
 * @email：ahwei163@qq.com
 * @since： 2022-05-25 16:40:14
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Schema(description="Product对象")
public class ProductDto {
    private static final long serialVersionUID = 1L;

    @Schema(description = "商品id")
    private Long id;

    @Schema(description = "商品名称")
    @NotEmpty
    @Size(min=1, max=10, message="name长度必须在1到10之间")
    private String name;

    @Schema(description = "商品价格")
    @NotNull
    private BigDecimal price;

    @Schema(description = "库存数量")
    @Min(1)
    private Integer stock;
}
